#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
    float sinTbl[360],cosTbl[360];
    int d;
    FILE *TblSin, *TblCos;
    if((TblSin=fopen("sinTbl.dat","wb"))==NULL)
        printf("ERRO");

    if((TblCos=fopen("cosTbl.dat","wb"))==NULL)
        printf("ERRO");
        //criação tabela sen/cos
    for(d=0;d<360;d++)
    {
        sinTbl[d]=sin(d);
        cosTbl[d]=cos(d);

    }
    printf("%d %d --- %d %d", (int)sinTbl[0], (int)sinTbl[359],(int)sin(0),(int)sin(90));

    fwrite(sinTbl,sizeof(float),360,TblSin);
    fwrite(cosTbl,sizeof(float),360,TblCos);

    fclose(TblSin);
    fclose(TblCos);
    return 0;
}
